package Initials;

import java.util.Hashtable;

import Market.Market;

public class InitBranch {
												/** Branch Data Array: {From, To, Branch Capacity, Reactance} */	  
	 private double[][] BranchData;
	 											/** Number of Branches*/
	 private int N;
	 
	 public Hashtable<String, Double> branchData  = new Hashtable<String, Double>();
	
//C-O-N-S-T-R-U-C-T-O-R-----------------------------------------------------------------------	 
	 public InitBranch(Market market){
	  
		  Hashtable<String, Double> branchData1  = new Hashtable<String, Double>();
		  Hashtable<String, Double> branchData2  = new Hashtable<String, Double>();
		  Hashtable<String, Double> branchData3  = new Hashtable<String, Double>();
		  Hashtable<String, Double> branchData4  = new Hashtable<String, Double>();
		  Hashtable<String, Double> branchData5  = new Hashtable<String, Double>();

	  for (int i=0; i<market.N; i++){				
			if (i == 0){								
				
				branchData1.put("from", 1.0);
				branchData1.put("to", 2.0);
				branchData1.put("capacity", 250.0);
				branchData1.put("reactance", 0.0281);
				
				branchData = branchData1;
			    int id = i+1;
			    
			    market.branchList.put("branch"+id, branchData);
			   // market.branchListONE = branchData1;
			  
			    // market.branchList.put("branch"+id, branchData1);
			}
			if (i == 1){		
				
				branchData2.put("from", 2.0);
				branchData2.put("to", 3.0);
				branchData2.put("capacity", 150.0);
				branchData2.put("reactance", 0.0304);
				
				branchData = branchData2;
				
			    int id = i+1;
			   
			    market.branchList.put("branch"+id, branchData);
			    // market.branchListTWO = branchData2;
			    //market.branchList.put("branch"+id, branchData2);
			}
			if (i == 2){
				
				branchData3.put("from", 3.0);
				branchData3.put("to", 4.0);
				branchData3.put("capacity", 400.0);
				branchData3.put("reactance", 0.0064);
				
				branchData = branchData3;
				
			    int id = i+1;
			  
			    market.branchList.put("branch"+id, branchData);
			    // market.branchListTHREE = branchData3;
			    //market.branchList.put("branch"+id, branchData3);
			}		
			if (i == 3){
				
				branchData4.put("from", 4.0);
				branchData4.put("to", 5.0);
				branchData4.put("capacity", 350.0);
				branchData4.put("reactance", 0.0108);
				
				branchData = branchData4;
								
			    int id = i+1;
			   
			    market.branchList.put("branch"+id, branchData);
			    // market.branchListFOUR = branchData4;
			    //market.branchList.put("branch"+id, branchData4);
			}
			if (i == 4){
				
				branchData5.put("from", 5.0);
				branchData5.put("to", 1.0);
				branchData5.put("capacity", 240.0);
				branchData5.put("reactance", 0.0297);
				
				branchData = branchData5;
				
				int id = i+1;
			   
			    market.branchList.put("branch"+id, branchData);
			    // market.branchListFIVE = branchData5;
			    //market.branchList.put("branch"+id, branchData5);
			}
		}
  }
}
  
  
//-----------------------------------------------------------------------------------------------------------------------------------------
//	/** Returns Branch Data  */	
 // 	public double[][] getBranchData(){	
	//	return BranchData;
	//}
 
//-----------------------------------------------------------------------------------------------------------------------------------------
//  	/** Returns number of branches */	
	//public int getNBranch(){		
	//	return N;
	//}	
	
